import request from '@/utils/request'

// 查询菜品管理列表
export function listDishes(query) {
  return request({
    url: '/system/coldDishes/list',
    method: 'get',
    params: query
  })
}

// 查询菜品管理详细
export function getDishes(dishesId) {
  return request({
    url: '/system/coldDishes/' + dishesId,
    method: 'get'
  })
}

// 新增菜品管理
export function addDishes(data) {
  return request({
    url: '/system/coldDishes',
    method: 'post',
    data: data
  })
}

// 修改菜品管理
export function updateDishes(data) {
  return request({
    url: '/system/coldDishes',
    method: 'put',
    data: data
  })
}

//修改状态
export function changeDishesStatus(dishesId, packageId) {
  const data = {
    dishesId,
    packageId
  }
  return request({
    url: '/system/coldDishes/changeStatus',
    method: 'put',
    data: data
  })
}

//购物车修改
export function shoppingChange(dishesId,shoppingChange) {
  const data={
    dishesId,
    shoppingChange
  }
  return request({
    url: '/system/coldDishes/shoppingChange',
    method: 'put',
    data: data
  })
}

// 删除菜品管理
export function delDishes(dishesId) {
  return request({
    url: '/system/coldDishes/' + dishesId,
    method: 'delete'
  })

}
